﻿using OA.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace OA.IBLL
{
    public interface IBaseService<T> where T :BaseModel
    {
        Task<bool> Add(T entity);
        Task<bool> Edit(T entity);
        Task<bool> Delete(T entity);
        Task<bool> Delete(int id);
        Task<T> GetEntityAsync(int id, bool tracking = false);
        Task<T> GetEntityAsync(Expression<Func<T, bool>> where, bool tracking = false);
        IQueryable<T> GetList(Expression<Func<T, bool>> where);
        IQueryable<T> GetList<O>(Expression<Func<T, bool>> where, int pageIndex, int pageSize, out int total, Expression<Func<T, O>> orderFieled, bool isAsc = true);
    }
}
